package com.project.controller;

import com.github.pagehelper.PageInfo;
import com.project.bean.ProductBean;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lyl
 * description:
 */
@RestController
@RequestMapping("product")
public class ProductController {
    @Autowired
    private IProductService iProductService;

    @RequestMapping("findByItem")
    public PageInfo<ProductBean> findByItem(int pageNo, String productName) {
        return iProductService.findByItem(pageNo, productName);
    }

    @RequestMapping("findById")
    public ProductBean findById(int productId) {
        return iProductService.findById(productId);
    }

}
